<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录 - 个人数据侵权损害赔偿智能预测系统</title>
    <style>
        body {
            margin: 0;
            height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            background: linear-gradient(135deg, #1a237e 0%, #0d47a1 50%, #01579b 100%);
            position: relative;
            overflow: hidden;
        }
        
        /* 背景动画效果 */
        body::before {
            content: '';
            position: absolute;
            width: 200%;
            height: 200%;
            top: -50%;
            left: -50%;
            z-index: 0;
            background: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
            background-size: 40px 40px;
            animation: backgroundMove 60s linear infinite;
        }
        
        .login-card {
            background: rgba(255, 255, 255, 0.85);
            padding: 35px;
            border-radius: 16px;
            box-shadow: 
                0 4px 30px rgba(0, 0, 0, 0.2),
                inset 0 1px 2px rgba(255, 255, 255, 0.9);
            width: 400px;
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        
        .login-card:hover {
            transform: translateY(-5px);
            box-shadow: 
                0 8px 40px rgba(0, 0, 0, 0.25),
                inset 0 1px 2px rgba(255, 255, 255, 0.9);
        }
        
        .login-card h1 {
            margin: 0 0 25px;
            text-align: center;
            color: #1a237e;
            font-size: 24px;
            font-weight: 600;
            text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
        }
        
        .form-group input {
            width: 100%;
            padding: 12px;
            border: 2px solid rgba(26, 35, 126, 0.1);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.9);
            transition: all 0.3s ease;
            color: #1a237e;
        }
        
        .form-group input:focus {
            transform: translateY(-2px);
            border-color: rgba(26, 35, 126, 0.3);
            box-shadow: 0 4px 15px rgba(26, 35, 126, 0.1);
            outline: none;
        }
        
        .login-btn {
            width: 100%;
            padding: 14px;
            background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(26, 35, 126, 0.2);
        }
        
        .login-btn:hover {
            background: linear-gradient(135deg, #0d47a1 0%, #1a237e 100%);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(26, 35, 126, 0.3);
        }
        
        .logo-container img {
            width: 80px;
            height: 80px;
            object-fit: contain;
            filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
            margin-bottom: 25px;
            transition: transform 0.3s ease;
        }
        
        .logo-container img:hover {
            transform: scale(1.05);
        }
    .login-card {
        background: white;
        padding: 30px;
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        width: 400px;
    }
    .login-card h1 {
        margin: 0 0 20px;
        text-align: center;
        color: #333;
        font-size: 24px;
    }
    .login-card img {
        width: 80px;  /* 修改为固定宽度 */
        height: 80px; /* 添加固定高度 */
        display: block; /* 使图片居中显示 */
        margin: 0 auto 20px; /* 调整边距，保持居中 */
        object-fit: contain; /* 确保图片比例正确 */
    }
    .form-group {
        margin-bottom: 15px;
    }
    .form-group input {
        width: 100%;
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-sizing: border-box;
    }
    .login-btn {
        width: 100%;
        padding: 12px;
        background: #4e73df;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 16px;
    }
    .login-btn:hover {
        background: #2e59d9;
    }
</style>
</head>
<body>
    <div><img src="./assets/icon.png" alt="登录横幅"></div>
    <div class="login-card">
        <h1>个人数据侵权损害赔偿智能预测系统</h1>
        <div class="form-group">
            <input type="text" id="username" placeholder="请输入用户名" required>
        </div>
        <div class="form-group">
            <input type="password" id="password" placeholder="请输入密码" required>
        </div>
        <button class="login-btn" onclick="login()">登录</button>
    </div>

    <script>
        // 检查登录状态
        if(localStorage.getItem('isLoggedIn') === 'true') {
            window.location.href = 'index.html';
        }

        function login() {
            const username = document.getElementById('username').value;
            const password = document.getElementById('password').value;

            if(!username) {
                alert('请输入用户名');
                return;
            }

            if(password !== 'jiajia') {
                alert('密码错误');
                return;
            }

            // 保存登录状态和用户名
            localStorage.setItem('isLoggedIn', 'true');
            localStorage.setItem('username', username);
            
            // 跳转到主页
            window.location.href = 'index.html';
        }
    </script>
</body>
</html>